global_defs {
 router_id k8s-{{KUBERNETES_VERSION}}
 script_user root
 enable_script_security
}

vrrp_script check_apiserver {
 script "/bin/bash /etc/keepalived/check_apiserver.sh"
 interval 3
 weight -2
 fall 10
 rise 2
}

vrrp_instance VI_K8S {
   state {{KEEPALIVED_STATE}}
   interface {{INTERFACE_NAME}}
   virtual_router_id {{VIRTUAL_ROUTER_ID}}
   priority {{KEEPALIVED_PRIORITY}}
   authentication {
       auth_type PASS
       auth_pass 4be37dc3b4c90194d1600c483e10ad1d
   }
   virtual_ipaddress {
       {{MASTER_VIP}}
   }
   track_script {
       check_apiserver
   }
}
